var FormData = new Object();

//json解析
FormData.toHtml = function(json,temp){
	var html = "";
	for(var w in json){
		//-----------非必要参数---------------------
		var pattern = json[w].pattern;
		pattern = pattern==null||pattern==undefined?"":" pattern='"+pattern.substring(1,pattern.length-1)+"' ";
		
		var required = json[w].required;
		required = required==null||required==undefined?"":" required ";
		
		var title = json[w].title;
		title = title==null||title==undefined?"":" title='"+title+"' ";
	//------------------------------------------

		/* if(json[w].type=='date'||json[w].type=='datestr'){
			
			html+="<input type='text' class='date'  name='"+json[w].name+"' placeholder='"+json[w].explain+"' "+pattern+required+title+"/>";
		}else  */
		if(json[w].type=="select"){
			html+="<div class='layui-input-inline'><select id='"+json[w].name+"' name='"+json[w].name+"' > <option value=''>"+json[w].explain+"</option>"
			var select = json[w].select;
			for(var s in select){
				for(var key in select[s]){
					var value = select[s][key];
					html+="<option value='"+value+"'>"+key+"</option>"
					//alert("key:"+key+",,value:"+value)
				}
			}
			html+="</select></div>"
		}else{
			html+="<div class='layui-input-inline'><input class='layui-input'  type='"+json[w].type+"' name='"+json[w].name+"' placeholder='"+json[w].explain+"' "+pattern+required+title+" /></div>";
		}
	}
	return html;
}